package cn.wolfcode.crm.service.impl;

import cn.wolfcode.crm.mapper.CustomerReportMapper;
import cn.wolfcode.crm.query.CustomerReportQuery;
import cn.wolfcode.crm.query.QueryObject;
import cn.wolfcode.crm.service.ICustomerReportService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class CustomerReportImpl implements ICustomerReportService {

    @Autowired
    private CustomerReportMapper customerReportMapper;
    /**
     *
     * @param qo
     * @return
     */
    @Override
    public PageInfo query(QueryObject qo) {

        PageHelper.startPage(qo.getCurrentPage(),qo.getPageSize());

        //查询结果集
        List<Map> list = customerReportMapper.slectCustomerReport(qo);
        //return new PageResult(qo.getCurrentPage(), count, list, qo.getPageSize());
        return new PageInfo(list);
    }

    @Override
    public List<Map> listAll(QueryObject qo) {
        return customerReportMapper.slectCustomerReport(qo);
    }

}
